<template>
  <div class="equipment" v-cloak>
    <list class="list">
      <cell class="listItem" v-for="(item, index) in companyData" :key="index" @click="addClassFun(item)" :class="[company === item.GSDM ? 'active' : '']">
        <text class="text" :class="[company === item.GSDM ? 'active' : '']">{{item.GSMC}}</text>
      </cell>
    </list>
  </div>
</template>
<script>
export default {
  name: 'factor',
  beforeCreate() {
      this.$notice.loading.show()
  },
  created () {
    this.$store.dispatch('getSBCJ', this)
  },
  methods: {
    addClassFun (item) {
      this.$store.commit('changeSbcj', item.GSDM)
      this.$store.dispatch('getAzddList', this)
      this.$emit('closeList')
    }
  },
  computed: {
    company () {
      return this.$store.state.sbcj
    },
    companyData () {
      return this.$store.state.sbcjData
    }
  }
}
</script>
<style scoped>
.equipment{
  width: 750px;
  background-color: rgba(0, 0, 0, 0.4);
  flex: 1;
}
.list{
  width: 750px;
}
.listItem{
  width: 750px;
  height: 100px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding-left: 20px; 
  border-bottom-color: #f5f5f5;
  border-bottom-style: solid;
  border-bottom-width: 1px;
  background-color: white;
}
.text{
  font-size: 29.1px;
  font-family:PingFangSC-Regular;
  color:rgba(102,102,102,1);
}
.active{
  color: #fff;
  background-color: rgba(62,175,252,1);
}
[v-cloak] {
  display: none;
}
</style>